Multiplication Table Generator
#include
using namespace std;
int main() {
int tableNum;
cout << "Enter the multiplication table you want to generate: ";
cin >> tableNum;
cout << "\nMultiplication table of " << tableNum << ":\n";
for (int i = 1; i <= 10; ++i) {
cout << tableNum << " x " << i << " = " << tableNum * i << endl;
}
return 0;
}
Code output
Enter the multiplication table you want to generate: 7
Multiplication table of 7:
7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70